﻿<Window x:Class="Gao.Poker.App.Win.CompetitionManageWin"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="比赛管理"  WindowStartupLocation="CenterScreen" ResizeMode="NoResize" Width="1100" >
    <Grid Margin="0">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="2*"/>
            <ColumnDefinition Width="8*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="40.73"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Border BorderBrush="White" BorderThickness="0,1" Margin="0,1,0,0" Grid.ColumnSpan="3">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#A1C7CFDA" Offset="0.991"/>
                    <GradientStop Color="#B5F1F1F1"/>
                    <GradientStop Color="#FFD2D2D2" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>
        </Border>
        <StackPanel Margin="0" Orientation="Horizontal" Grid.Column="0" Grid.ColumnSpan="2">
            <Button Content="报名" Name="btnApply" Click="Apply_Click" HorizontalAlignment="Left" Style="{DynamicResource MyButton}" Width="101" Height="25" />
            <Border BorderBrush="#CCFFFFFF" BorderThickness="1,0,0,0" HorizontalAlignment="Left"  Width="2.5" Background="#FFB6B6B6"/>
            <Button Content="买入" Name="btnBuy" Click="Buy_Click" HorizontalAlignment="Left" Style="{DynamicResource MyButton}" Width="101" Height="25" />
            <Border BorderBrush="#CCFFFFFF" BorderThickness="1,0,0,0" HorizontalAlignment="Left"  Width="2.5" Background="#FFB6B6B6"/>
            <Button Content="奖金分配" Name="btnbonus" Click="Bonus_Click" HorizontalAlignment="Left" Style="{DynamicResource MyButton}" Width="101" Height="25" />
            <Border BorderBrush="#CCFFFFFF" BorderThickness="1,0,0,0" HorizontalAlignment="Left"  Width="2.5" Background="#FFB6B6B6"/>
            <Button Content="比赛结束" Name="btnEnd" Click="End_Click" HorizontalAlignment="Left" Style="{DynamicResource MyButton}" Width="101" Height="25" />
            <Border BorderBrush="#CCFFFFFF" BorderThickness="1,0,0,0" HorizontalAlignment="Left"  Width="2.5" Background="#FFB6B6B6"/>
        </StackPanel>

        <DockPanel Margin="0" Grid.Column="0" Grid.Row="1">
            <ListView Name="listView" Margin="0,0,0,0" DockPanel.Dock="Top" ItemsSource="{Binding Path=Competitions}" 
                      SelectedItem="{Binding Path=AllCompetitions}" Padding="0"
              VirtualizingStackPanel.VirtualizationMode="Recycling">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <Grid Margin="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <StackPanel Grid.Column="0" Grid.ColumnSpan="2" Margin="0">
                                <TextBlock FontWeight="Bold"
                                        Text="{Binding Path=Name}" />
                                <TextBlock Text="{Binding Path=Date, StringFormat='yyyy-MM-dd'}"
                                        TextTrimming="CharacterEllipsis" />
                            </StackPanel>
                        </Grid>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </DockPanel>
        <TabControl Margin="5" Grid.Column="1" Grid.Row="1">
            <TabItem Header="报名情况">
                <DataGrid Margin="1,1,1.2,1" VerticalAlignment="Top" RowHeight="30" AutoGenerateColumns="False"
                    SelectionMode="Single"  CanUserAddRows="True" CellStyle="{StaticResource Body_Content_DataGrid_Centering}"
                    AlternatingRowBackground="Gainsboro" ItemsSource="{Binding Members}"  AlternationCount="2" IsReadOnly="True"
                    FontSize="16" Name="dgMembers" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="卡号" Width="120" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=CardNo}"/>
                        <DataGridTextColumn Header="姓名" Width="80" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=Name}"/>
                        <DataGridTextColumn Header="手机号" Width="100" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=Telephone}"/>
                        <DataGridTextColumn Header="积分" Width="*" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=Points}"/>
                        <DataGridTextColumn Header="座位号" Width="*" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=SeatNum}"/>
                        <DataGridTextColumn Header="买入" Width="40" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=BuyNumber}"/>
                        <DataGridTextColumn Header="重新买入" Width="80" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=BuyAgainNumber}"/>
                        <DataGridTextColumn Header="最后买入" Width="80" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=BuyLastNumber}"/>
                        <DataGridTextColumn Header="买入金额" Width="80" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=BuyMoney}"/>
                        <DataGridTextColumn Header="比赛名次" Width="80" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=Rank}"/>
                        <DataGridTextColumn Header="比赛奖金" Width="80" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=Bonus}"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem Header="比赛信息">
                <ScrollViewer Margin="5" Grid.Column="1" Grid.Row="1">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="100"/>
                            <ColumnDefinition Width="600"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="30"/>
                            <RowDefinition Height="30"/>
                            <RowDefinition Height="30"/>
                            <RowDefinition Height="30"/>
                            <RowDefinition Height="30"/>
                            <RowDefinition Height="30"/>
                            <RowDefinition Height="30"/>
                            <RowDefinition Height="30"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>

                        <TextBlock Text="比赛名称：" Margin="1" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Right"/>
                        <TextBlock Text="{Binding Path=Competition.Name}" Margin="1" VerticalAlignment="Center" Grid.Column="1" Grid.Row="0"/>

                        <TextBlock Text="比赛时间："  Margin="1" VerticalAlignment="Center" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right"/>
                        <TextBlock Text="{Binding Path=Competition.Date, StringFormat='yyyy-MM-dd'}" VerticalAlignment="Center" Margin="1" Grid.Column="1" Grid.Row="1"/>

                        <TextBlock Text="当前总码数：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="2"/>
                        <TextBlock Text="{Binding Path=Competition.TotalBet, Mode=TwoWay}" Margin="1"  VerticalAlignment="Center" Grid.Column="1" Grid.Row="2"/>

                        <TextBlock Text="买入人数：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="3"/>
                        <TextBlock Text="{Binding Path=Competition.BuyNumber, Mode=TwoWay}"  Margin="1"  VerticalAlignment="Center" Grid.Column="1" Grid.Row="3"/>

                        <TextBlock Text="重新买入人数：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="4"/>
                        <TextBlock Text="{Binding Path=Competition.BuyAgainNumber, Mode=TwoWay}" Margin="1"  VerticalAlignment="Center" Grid.Column="1" Grid.Row="4"/>

                        <TextBlock Text="最后买入人数：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="5"/>
                        <TextBlock Text="{Binding Path=Competition.BuyLastNumber, Mode=TwoWay}" Margin="1"  VerticalAlignment="Center" Grid.Column="1" Grid.Row="5"/>

                        <TextBlock Text="单注金额：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="6"/>
                        <TextBlock Text="{Binding Path=Competition.SingleAmount, Mode=TwoWay}" Margin="1"  VerticalAlignment="Center" Grid.Column="1" Grid.Row="6"/>

                        <TextBlock Text="保底奖金：" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="7"/>
                        <TextBlock Text="{Binding Path=Competition.DownsideBonus, Mode=TwoWay}" Margin="1" VerticalAlignment="Center"  Grid.Column="1" Grid.Row="7"/>

                        <TextBlock Text="比赛级别：" HorizontalAlignment="Right" Margin="1" Grid.Column="0" Grid.Row="8"/>
                        <DataGrid Margin="1" Height="200" VerticalAlignment="Top" Grid.Column="1"  Grid.Row="8" RowHeight="30" AutoGenerateColumns="False"
                            SelectionMode="Single"  CanUserAddRows="True" CellStyle="{StaticResource Body_Content_DataGrid_Centering}"
                            AlternatingRowBackground="Gainsboro"  AlternationCount="2" IsReadOnly="True"
                            ItemsSource="{Binding Path=Competition.CompetitionLevels, Mode=TwoWay}" FontSize="16">
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="级别" Width="Auto" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=Level, Mode=TwoWay}"/>
                                <DataGridTextColumn Header="比赛时间" Width="80" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=CompetitionTime, Mode=TwoWay}"/>
                                <DataGridTextColumn Header="盲注" Width="120" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=Blind, Mode=TwoWay}"/>
                                <DataGridTextColumn Header="前置休息时间" Width="*" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=AfterRestTime, Mode=TwoWay}"/>
                                <DataGridTextColumn Header="附加前注" Width="*" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=AppendGamble, Mode=TwoWay}"/>
                            </DataGrid.Columns>
                        </DataGrid>
                    </Grid>
                </ScrollViewer>
            </TabItem>
        </TabControl>
    </Grid>
</Window>
